package vip.xianz.jobmanager.data.entity;

import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.Instant;

/**
 * 用户
 * @author xian5
 * @Instant 2019-5-6 19:02:08
 */
public class XUser implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
     * 用户id
     */
	@NotNull(message = "validate.notNull")
    @Length(min = 6, max = 32, message = "validate.userId")
    private String userId;

    /**
     * 真实姓名
     */
    @Length(min = 2, max = 20)
    private String realName;

    /**
     * 昵称
     */
    @Length(min = 2, max = 30)
    private String nickName;

    /**
     * 密码
     */
    @Length(min = 6, max = 32)
    private String password;

    /**
     * 性别 0=保密/1=男/2=女
     */
    private Byte sex;

    /**
     * 年龄
     */
    private Byte age;

    /**
     * 邮件
     */
    private String email;

    /**
     * 最后登录时间
     */
    private Instant lastLoginTime;

    /**
     * 最后登录ip
     */
    private String lastLoginIp;

    /**
     * 创建时间
     */
    private Instant createTime;

    /**
     * 修改时间
     */
    private Instant updateTime;

    /**
     * 头像
     */
    private String avatar;

    /**
     * 用户状态 0=邮箱未激活/1=正常/2=禁止登陆
     */
    private Byte status;

    /**
     * 角色编号
     */
    private Long roleId;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId == null ? null : userId.trim();
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName == null ? null : realName.trim();
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName == null ? null : nickName.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public Byte getSex() {
        return sex;
    }

    public void setSex(Byte sex) {
        this.sex = sex;
    }

    public Byte getAge() {
        return age;
    }

    public void setAge(Byte age) {
        this.age = age;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }

    public Instant getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Instant lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public String getLastLoginIp() {
        return lastLoginIp;
    }

    public void setLastLoginIp(String lastLoginIp) {
        this.lastLoginIp = lastLoginIp == null ? null : lastLoginIp.trim();
    }

    public Instant getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Instant createTime) {
        this.createTime = createTime;
    }

    public Instant getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Instant updateTime) {
        this.updateTime = updateTime;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar == null ? null : avatar.trim();
    }

    public Byte getStatus() {
        return status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }
}